<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<script>
 	function deleteFunction(frm){
 		var isDel = confirm("Bạn có muốn xóa sản phẩm này?");
 		if (isDel) {
 			return true;
 		} else {
 			return false;
 		}
 	}
</script>
<div id="content-block">
	<div id="breadcrumb">
		<div class="breadcrumb">
			<a href="home.html">Trang chủ</a> » <a href="listsaleoff.html">Sản
				phẩm khuyến mãi</a>
		</div>
	</div>

	<div id="page-title">Sản phẩm khuyến mãi</div>

	<div
		class="view view-uc-products-frontpage view-id-uc_products_frontpage view-display-id-block_1 view-dom-id-11">
		<div id="view-content" class="view-content">
			<table>
				<tr>
					<td><c:forEach var="pro" items="${listsaleoff}">


							<div class="views-row views-row-1 views-row-odd views-row-first">

								<div class="views-field-title">
									<span class="field-content"><a
										href="detailproduct.html?id=${pro.id}">${pro.name}</a></span>
									<c:if test="${not empty isAdmin}">
										<form name="frmDel${pro.id}" action='delPro.do' method="post">
											<input type="hidden" name="key" value="${pro.key}" /> <input
												type="hidden" name="id" value="${pro.id}" />
											<button onclick='return deleteFunction("frmDel${pro.id}");'>-</button>
										</form>
									</c:if>
								</div>

								<div class="views-field-sell-price">
									<label class="views-label-sell-price"> Giá bán: </label> <span
										class="field-content"> <span name="uc_price_name"
										class="uc-price-product uc-price-sell_price uc-price">${pro.newPrice}</span>/${pro.unit}
									</span>
								</div>

								<div class="views-field-field-image-cache-fid">
									<div class="field-content">
										<a href="detailproduct.html?id=${pro.id}"><a
											href="detailproduct.html?id=${pro.id}"
											class="imagecache imagecache-product_list imagecache-linked imagecache-product_list_linked"><img
												src="/display.html?imageKey=${pro.imageKey}" alt=""
												title="${pro.name}"
												class="imagecache imagecache-product_list" width="100"
												height="75" /></a></a>
									</div>
								</div>

								<div class="views-field-teaser">
									<div class="field-content">
										<p>${pro.info}</p>
									</div>
								</div>

								<c:choose>
										   <c:when test="${pro.quantity > 0}">
												<div class="views-field-addtocartlink">
													<label class="views-label-field-packaging-standard-value" style="display: inline;">Số lượng: </label>
													<form action="/booking.html" method="post">
														<input type="hidden" name="code" value="${pro.id}" />
														<input type="hidden" name="page" value="home" />
														<input type="number" maxlength="3" name="quantity" id="quantity" size="3" value="1" class="form-text" min="1" max="${pro.quantity}">												
														<div class="field-content" style="padding-left: 33px; display: inline;">
															<input type="image" src="/images/sp_cart.jpg" name="submit"	class="states">
														</div>
											</form>
												</div>
											</c:when> 
										   
										   <c:otherwise>
										   		<div class=field-content>
													<img src="./images/sold_out.png" width=100 height=50>
												</div>
										   </c:otherwise>    
										</c:choose>


								<div class="views-field-ops">
									<span class="field-content"></span>
								</div>
							</div>
						</c:forEach></td>
				</tr>
			</table>
		</div>
	</div>
	<div style="margin: auto; padding-left: 25px; width: 305px;">

		<button id="more_product"
			style="background: #ff9726; width: 305px; border: 0.5px soild;">
			<p style="font-size: 20px; color: #ffffff;">Xem thêm sản phẩm</p>
		</button>

	</div>
</div>

